/*
 * Copyright 2003-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.edu.tsinghua.cic.ccss.dto;

import java.util.Date;

import org.forten.core.dto.GeneralDto;
import org.forten.dataio.excel.model.ImportCellDef;
import org.forten.dataio.excel.model.ImportCellDef.ImportCellDataType;
import org.forten.utils.common.StringUtil;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * @since 2012-5-13
 */
public class CourseDto4Import implements GeneralDto {
	private static final long serialVersionUID = 7071635248630286710L;

	@ImportCellDef(colNum = 0)
	private String name;// 课程名称
	@ImportCellDef(colNum = 1)
	private String courseInfo;// 课程简介
	@ImportCellDef(colNum = 2)
	private String teacherName;// 上课教师姓名
	@ImportCellDef(colNum = 3)
	private String teacherInfo;// 上课教师简介
	@ImportCellDef(colNum = 4, dataType = ImportCellDataType.DATE, datePattern = "yyyy-MM-dd hh:mm")
	private Date teachTime;// 上课时间
	@ImportCellDef(colNum = 5)
	private String classroom;// 上课地点
	@ImportCellDef(colNum = 6, dataType = ImportCellDataType.INTEGER)
	private int credit;// 学分
	@ImportCellDef(colNum = 7)
	private String headTeacherName;// 班主任姓名
	@ImportCellDef(colNum = 8, dataType = ImportCellDataType.INTEGER)
	private int classCapacity;// 课容量

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		if (StringUtil.hasText(name))
			this.name = name.trim();
		else
			this.name = "";
	}

	/**
	 * @return the teachTime
	 */
	public Date getTeachTime() {
		return teachTime;
	}

	/**
	 * @param teachTime
	 *            the teachTime to set
	 */
	public void setTeachTime(Date teachTime) {
		this.teachTime = teachTime;
	}

	/**
	 * @return the classroom
	 */
	public String getClassroom() {
		return classroom;
	}

	/**
	 * @param classroom
	 *            the classroom to set
	 */
	public void setClassroom(String classroom) {
		if (StringUtil.hasText(classroom))
			this.classroom = classroom.trim();
		else
			this.classroom = "";
	}

	/**
	 * @return the courseInfo
	 */
	public String getCourseInfo() {
		return courseInfo;
	}

	/**
	 * @param courseInfo
	 *            the courseInfo to set
	 */
	public void setCourseInfo(String courseInfo) {
		if (StringUtil.hasText(courseInfo))
			this.courseInfo = courseInfo.trim();
		else
			this.courseInfo = "";
	}

	/**
	 * @return the teacherName
	 */
	public String getTeacherName() {
		return teacherName;
	}

	/**
	 * @param teacherName
	 *            the teacherName to set
	 */
	public void setTeacherName(String teacherName) {
		if (StringUtil.hasText(teacherName))
			this.teacherName = teacherName.trim();
		else
			this.teacherName = "";
	}

	/**
	 * @return the teacherInfo
	 */
	public String getTeacherInfo() {
		return teacherInfo;
	}

	/**
	 * @param teacherInfo
	 *            the teacherInfo to set
	 */
	public void setTeacherInfo(String teacherInfo) {
		if (StringUtil.hasText(teacherInfo))
			this.teacherInfo = teacherInfo.trim();
		else
			this.teacherInfo = "";
	}

	/**
	 * @return the headTeacherName
	 */
	public String getHeadTeacherName() {
		return headTeacherName;
	}

	/**
	 * @param headTeacherName
	 *            the headTeacherName to set
	 */
	public void setHeadTeacherName(String headTeacherName) {
		if (StringUtil.hasText(headTeacherName))
			this.headTeacherName = headTeacherName.trim();
		else
			this.headTeacherName = "";
	}

	/**
	 * @return the classCapacity
	 */
	public int getClassCapacity() {
		return classCapacity;
	}

	/**
	 * @param classCapacity
	 *            the classCapacity to set
	 */
	public void setClassCapacity(int classCapacity) {
		this.classCapacity = classCapacity;
	}

	/**
	 * @return the credit
	 */
	public int getCredit() {
		return credit;
	}

	/**
	 * @param credit
	 *            the credit to set
	 */
	public void setCredit(int credit) {
		this.credit = credit;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "CourseDto4Import [name=" + name + ", courseInfo=" + courseInfo
				+ ", teacherName=" + teacherName + ", teacherInfo="
				+ teacherInfo + ", teachTime=" + teachTime + ", classroom="
				+ classroom + ", credit=" + credit + ", headTeacherName="
				+ headTeacherName + ", classCapacity=" + classCapacity + "]";
	}
}
